class autopyfactory {

  user { "atlas":
    name => "atlas",
    ensure => present,
    managehome => true,
  }
  
  package { "panda-autopyfactory":
    provider => rpm,
    source => "http://svr017.gla.scotgrid.ac.uk/factory/release/apf/1.1.0-silent-running/panda-autopyfactory-1.1.0-2.noarch.rpm",
    ensure => installed, 
  }

  package {["python-simplejson","pycurl"]:
  }
  
  file { "/opt/panda/autopyfactory/var":
    ensure => directory,
  }
  
  file { "base.conf":
    path => "/opt/panda/autopyfactory/var/base.conf",
    content => template("autopyfactory/base.conf.erb"),
    mode => 644,
    ensure => file,
    require => Package["panda-autopyfactory"],
  }

  file { "/etc/init.d/autopyfactory":
    content => template("autopyfactory/init.d.erb"),
    mode => 755,
    ensure => file,
    require => Package["panda-autopyfactory"],    
  }

  file { "/opt/panda/userinterface":
        ensure => directory,
      }
      
  
  file { "Client.py":
    path => "/opt/panda/userinterface/Client.py",
    source => "puppet:///modules/autopyfactory/Client.py",
  }

  file { "__init__.py":
          path => "/opt/panda/userinterface/__init__.py",
          source => "puppet:///modules/autopyfactory/__init__.py",
        }
        
}
